package com.baidu.mapper;

import com.baidu.pojo.TbShopAudit;
import com.baidu.vo.SellerManageVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Entity com.baidu.pojo.TbShopAudit
 */
@Mapper
@Component
public interface TbShopAuditMapper extends BaseMapper<TbShopAudit> {

    @Select("select * from tb_shop_audit where  instr(company_name,#{name}) and instr(shop_name,#{name2}) ")
    Page<TbShopAudit> findList(Page<TbShopAudit> objectPage, @Param("name") String name, @Param("name2") String name2);

    @Update("update tb_shop_audit set status = 1 where id = #{id}")
    void auditPass(@Param("id") Integer id);

    @Update("update tb_shop_audit set status = 0 where id = #{id}")
    void auditRefuse(@Param("id") Integer id);


//    IPage<TbShopAudit> pageListBy(Page<TbShopAudit> page, @RequestBody SellerManageVo vo);

    IPage<TbShopAudit> pageListBy(Page<TbShopAudit> page, String companyName, String shopName, Integer state);
}




